package main

import (
	"fmt"
	"gitee.com/byx_darwin/ncloud-go/core"
	"gitee.com/byx_darwin/ncloud-go/services/cdn/apis"
	"gitee.com/byx_darwin/ncloud-go/services/cdn/client"
)

const (
	accessKey = "**********"
	secretKey = "*************"
)

func main() {
	// 获取第一个参数（除了程序名）
	//if len(os.Args) > 3 {
	//	fmt.Printf("The first argument is: %s\n", os.Args[1])
	//	fmt.Printf("The second argument is: %s\n", os.Args[2])
	//	fmt.Printf("The third argument is: %s\n", os.Args[3])
	//} else {
	//	fmt.Println("No arguments provided.")
	//	return
	//}
	//credentials := core.NewCredentials(accessKey, secretKey)
	//gatewayClient := client.NewGatewayClient(credentials)
	//table, _ := strconv.Atoi(os.Args[3])
	//taskList := make([]apis.TcpTaskInfo, 0, 1)
	//taskList = append(taskList, apis.TcpTaskInfo{
	//	Region: "Asia-China-Shenzhen-ChinaTelecom",
	//	UUID:   os.Args[2],
	//	Table:  int32(table),
	//})
	//dataRequest := apis.NewTcpTaskCreateRequestWithTcpTaskList(taskList, os.Args[1])
	//dataResponse, err := gatewayClient.CreateTcpTask(dataRequest)
	//if err != nil {
	//	fmt.Println("err:", err)
	//}
	//fmt.Println("dataResponse:", dataResponse)
	credentials := core.NewCredentials(accessKey, secretKey)
	cdnClient := client.NewCdnClient(credentials)
	dataRequest := apis.NewQueryContentRequestWithTaskID("6564519476686099221-25fdad2328d09106f32ae5b333d247c1")
	//dataRequest := apis.NewQueryContentRequestWithTaskID("5009412009121384078-6ebc216c59c8a028c92d0b1336b92657")

	dataResponse, err := cdnClient.QueryContent(dataRequest)
	if err != nil {
		fmt.Println(err)
	} else {
		fmt.Println(dataResponse)
	}
}
